define(['frontend'], function (Frontend) {
    $('body').on('click', '[data-tips-image]', function () {
        var img = new Image();
        var top = document.body.scrollTop;
        var imgWidth = this.getAttribute('data-width') || '480px';
        img.onload = function () {
            var $content = $(img).appendTo('body').css({background: '#fff', width: imgWidth, height: 'auto',padding:'5px'});
            Layer.open({
                type: 1, area: imgWidth, title: false, closeBtn: 1,top:'10px',
                skin: 'layui-layer-nobg', shadeClose: true, content: $content,
                offset: top + 20,
                end: function () {
                    $(img).remove();
                },
                success: function () {

                }
            });
        };
        img.onerror = function (e) {

        };
        img.src = this.getAttribute('data-tips-image') || this.src;
    });

    $('body').on('click', '.notice-alert', function () {
        var c = $(this).data('alert');
        $('.'+c).removeClass('hide');
    });
    $('body').on('click', '.close', function () {
        var c = $(this).data('alert');
        $('.'+c).addClass('hide');
    })
});